import React from 'react'

export async function getServerSideProps(context) {  
    const { query } = context;  
    const { id } = query;  
    
    const data = { p1: id }; 
    console.log('Data in getServerSideProps:', data);

    return { props: { data } };  
}

export default function Example({ data }) {  
    console.log('Data in Example component:', data);

    return (  
        <div>  
            {data && data.p1}  {/* 确保访问数据前先进行存在性检查 */}
        </div>  
    );  
}
